package socket;


import socket.modle.PlcInterface;
import socket.socket.SocketClientUtil;
import socket.socket.SocketServerUtil;

/**
 * Created by bpb on 2019/8/25
 * 说明：
 */
public class PLCFactory {

    public static final int SOCKET_SERVER = 1;
    public static final int SOCKET_CLIENT = 2;

    public static PlcInterface getPlcUtil(int type, String tag) {
        PlcInterface plc = null;
        switch (type) {
            case SOCKET_CLIENT:
                plc = new SocketClientUtil();
                break;
            case SOCKET_SERVER:
            default:
                plc = new SocketServerUtil(tag);
                break;
        }
        return plc;
    }
}
